package com.lsy.android.pingpang.view;

import com.lsy.android.pingpang.R;

import android.app.Activity;
import android.view.MotionEvent;

public class TwoPlayerView extends GameView {

	public TwoPlayerView(Activity activity) {
		super(activity);
	}

	@Override
	String getPlayer1Name() {
		return "Player1";
	}

	@Override
	String getPlayer2Name() {
		return "Player2";
	}

	@Override
	int getTitleDrawableId() {
		return R.drawable.game_title2;
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {
		if (event.getY(0) > (float) (yMax * 3 / 4)) {
			Meio1 = event.getX(0);
		}
		if (event.getPointerCount() > 1) {
			if (event.getY(1) > (float) (yMax * 3 / 4)) {
				Meio1 = event.getX(1);
			}
		}

		if (event.getY(0) < (float) (yMax / 4)) {
			Meio2 = event.getX(0);
		}
		if (event.getPointerCount() > 1) {
			if (event.getY(1) < (float) (yMax / 4)) {
				Meio2 = event.getX(1);
			}
		}
		return true;
	}

	@Override
	boolean autoUptateBat() {
		return false;
	}

	@Override
	boolean showStartButton() {
		return true;
	}

	@Override
	int getGameViewStyle() {
		return 1;
	}

}
